#include<bits/stdc++.h>
using namespace std;

int main(){
  int T;
  cin >> T;
  while(T--){
    int n, k;
    cin >> n >> k;
    vector<int> v(n);
    for (int& i : v) cin >> i;
    long long sum = 0;
    for(int x : v) {
      if(x > 0) sum += x;
    }
    cout << sum << endl;
  }
  return 0;
}